<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Winsys extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
        $this->load->view('template');
    }

    public function dashboard() {
        
    }

    public function laporan() {
        $this->load->model('Laporan_model');
        $query = $this->Laporan_model->get_laporan_sorted();

        $data['query'] = $query;
        $data['main_view'] = 'tabel_laporan';

        $this->load->view('template', $data);
    }

    public function sekolah() {
        $this->load->model('Sekolah_model');
        $query = $this->Sekolah_model->get_sekolah_sorted();

        $data['query'] = $query;
        $data['main_view'] = 'tabel_sekolah';

        $this->load->view('template', $data);
    }
    
    public function user() {
        $this->load->model('User_model');
        $query = $this->User_model->get_user_sorted();

        $data['query'] = $query;
        $data['main_view'] = 'tabel_user';

        $this->load->view('template', $data);
    }

    public function laporan_sekolah($id) {
        $this->load->model('Laporan_model');
        $query = $this->Laporan_model->get_laporan_by_sekolah($id);

        $data['query'] = $query;
        $data['main_view'] = 'tabel_laporan';

        $this->load->view('template', $data);
    }
    
    public function laporan_user($id) {
        $this->load->model('Laporan_model');
        $query = $this->Laporan_model->get_laporan_by_user($id);

        $data['query'] = $query;
        $data['main_view'] = 'tabel_laporan';

        $this->load->view('template', $data);
    }
    
    
    
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */